package com.example.api;

import com.example.api.mapper.ApiMapper;
import com.example.api.model.TbConfig;
import com.example.api.service.ApiService;
import com.example.api.util.SpringUtils;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import java.util.List;

@SpringBootApplication
@MapperScan("com.example.api.mapper")
public class ApiApplication {

    public static void main(String[] args) {
        SpringApplication.run(ApiApplication.class, args);
        List<TbConfig> configList = TbConfig.CONFIG_LIST;
        ApiService apiService = SpringUtils.getBean(ApiService.class);
        apiService.insertConfig(configList);
    }

}
